//
//  TicketSelectView.m
//  Traveling
//
//  Created by 尹桥印 on 15/6/10.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "TicketSelectView.h"

@interface TicketSelectView()
@property (weak, nonatomic) IBOutlet UIButton *btnAir;
@property (weak, nonatomic) IBOutlet UIButton *btnTrain;
@property (weak, nonatomic) IBOutlet UIButton *btnCar;

@end

@implementation TicketSelectView

+(instancetype)ticketView{
    return [[[NSBundle mainBundle] loadNibNamed:@"TicketSelectView" owner:nil options:nil] lastObject];
}

- (IBAction)btnClick:(UIButton *)sender {
    
    TicketSelectViewClickType type;
    switch (sender.tag) {
        case 1:
            //飞机票
            type = TicketSelectViewClickTypeAir;
            break;
        case 2:
            //火车票
            type = TicketSelectViewClickTypeTrain;
            break;
        case 3:
            //汽车票
            type = TicketSelectViewClickTypeCar;
            break;
    }
    
    if ([self.delegate respondsToSelector:@selector(ticketBtnClick:type:)]) {
        [self.delegate ticketBtnClick:self type:type];
    }
}


@end
